<template>
  <div class="landlord">
    <detailSection title-text="房东介绍" footer-text="查看房东主页">
      <div class="top">
        <img :src="landlordData.topScroll" alt="" />
      </div>
      <div class="head">
        <div class="left">
          <img class="head-img" :src="landlordData.hotelLogo" alt="" />
          <div class="landlord-info">
            <div class="name">{{ landlordData.hotelName }}</div>
            <template
              v-for="(item, index) in landlordData.hotelTags"
              :key="index"
            >
              <span :style="{ color: item.tagText.color }">
                {{ item.tagText.text }}
              </span>
              <span
                class="vertical"
                :style="{ color: item.tagText.color }"
                v-if="index != landlordData.hotelTags.length - 1"
                >|</span
              >
            </template>
          </div>
        </div>
        <div class="right">联系房东</div>
      </div>
      <div class="content">
        <template
          v-for="(item, index) of landlordData.hotelSummary"
          :key="index"
        >
          <div class="content-item">
            <div class="rate">{{ item.title }}</div>
            <div class="percentage">
              {{ item.introduction }}
            </div>
            <div class="decs">
              {{ item.tip }}
            </div>
          </div>
        </template>
      </div>
    </detailSection>
  </div>
</template>

<script setup>
import detailSection from "../../../components/detail-section/detail-section.vue";

defineProps({
  landlordData: {
    type: Object,
    default: () => ({}),
  },
});
</script>

<style lang="less" scoped>
.landlord {
  .top {
    img {
      width: 100%;
    }
  }
  .head {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 5px;
    .left {
      display: flex;
      .head-img {
        width: 54px;
        height: 54px;
        -webkit-border-radius: 50%;
        border-radius: 50%;
        background-size: 40% auto;
      }
      .landlord-info {
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        line-height: 1.5;
        flex: 1;
        margin: 0 8px 0 12px;
      }
    }
    .right {
      height: 24px;
      padding-left: 12px;
      padding-right: 12px;
      line-height: 24px;
      background-color: var(--color);
      -webkit-border-radius: 4px;
      border-radius: 4px;
      color: #fff;
      text-align: center;
      font-size: 12px;
      margin-top: 2px;
    }
  }
  .vertical {
    margin: 0 2px;
  }
  .content {
    display: flex;
    .content-item {
      flex: 1;
      .rate {
        font-size: 10px;
        color: #999;
      }
      .percentage {
        font-size: 18px;
        color: #333;
        font-weight: 600;
        margin: 4px 0 2px;
      }
      .desc {
        font-size: 11px;
        color: #666;
      }
    }
  }
}
</style>
